#include <opencv2\opencv.hpp>
using namespace cv;
int main()
{
    Mat image = imread("image0.jpg");
    Mat replicate, reflect, reflect301, wrap, constant;
    copyMakeBorder(image, replicate, 30, 30, 30, 30, BORDER_REPLICATE);
    copyMakeBorder(image, reflect, 30, 30, 30, 30, BORDER_REFLECT);
    copyMakeBorder(image, reflect301, 30, 30, 30, 30, BORDER_REFLECT_101);
    copyMakeBorder(image, wrap, 30, 30, 30, 30, BORDER_WRAP);
    copyMakeBorder(image, constant, 30, 30, 30, 30, BORDER_CONSTANT, Scalar(255, 0, 0));
    imshow("replicate", replicate);
    imshow("reflect", reflect);
    imshow("reflect301", reflect301);
    imshow("wrap", wrap);
    imshow("constant", constant);
    waitKey(0);
    return 0;
}